var qdms_PopupHeight = null; var qdms_PopupWidth = null; let instanceName = localStorage.getItem('qdmsInstanceName'); let defaultColor = '#751748'; let defaultImage = '../app_themes/NewDesing/Themes/Theme1.png'; function updateLocalStorage(key, value, override) { if (!localStorage.getItem(key) || override) localStorage.setItem(key, value); } $(document).ready(function () { var $div = $('
').prependTo('body'); $div.attr('class', 'low-opacity-bg-image'); const root = document.querySelector(':root'); if (localStorage.getItem(instanceName + '_qdmsUserBackgroundColor')) { defaultColor = localStorage.getItem(instanceName + '_qdmsUserBackgroundColor'); } if (localStorage.getItem(instanceName + '_qdmsUserBackgroundImage')) { defaultImage = localStorage.getItem(instanceName + '_qdmsUserBackgroundImage'); } root.style.setProperty('--theme-color', defaultColor); root.style.setProperty('--theme-image', defaultImage); GetQdmsTables(); SetButtonHover(); if (typeof (Sys) !== "undefined") { var instance = Sys.WebForms.PageRequestManager.getInstance(); if (instance._postBackSettings == null) instance._postBackSettings = { "async": false } } }); $(window).resize(function () { GetQdmsTables(); }); if (!String.prototype.includes) { String.prototype.includes = function (search, start) { 'use strict'; if (search instanceof RegExp) { throw TypeError('first argument must not be a RegExp'); } if (start === undefined) { start = 0; } return this.indexOf(search, start) !== -1; }; } if (!Array.prototype.includes) { Object.defineProperty(Array.prototype, 'includes', { value: function (searchElement, fromIndex) { if (this == null) { throw new TypeError('"this" is null or not defined'); } // 1. Let O be ? ToObject(this value). var o = Object(this); // 2. Let len be ? ToLength(? Get(O, "length")). var len = o.length >>> 0; // 3. If len is 0, return false. if (len === 0) { return false; } // 4. Let n be ? ToInteger(fromIndex). // (If fromIndex is undefined, this step produces the value 0.) var n = fromIndex | 0; // 5. If n ≥ 0, then // a. Let k be n. // 6. Else n < 0, // a. Let k be len + n. // b. If k < 0, let k be 0. var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); function sameValueZero(x, y) { return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y)); } // 7. Repeat, while k < len while (k < len) { // a. Let elementK be the result of ? Get(O, ! ToString(k)). // b. If SameValueZero(searchElement, elementK) is true, return true. if (sameValueZero(o[k], searchElement)) { return true; } // c. Increase k by 1. k++; } // 8. Return false return false; } }); } if (!String.prototype.startsWith) { String.prototype.startsWith = function (search, pos) { return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; }; } function DeleteControlFromGrid(grd, mesaj) { if (grd.GetRowKey(grd.GetFocusedRowIndex()) == null) return false; return window.confirm(mesaj); } function DeleteControl(mesaj) { return window.confirm(mesaj); } function Control(mesaj) { return window.confirm(mesaj); } function AramaKriterleriniGizleAc() { if (document.getElementById('tblKriterler').style.visibility == 'hidden') { document.getElementById('tblKriterler').style.visibility = 'visible'; document.getElementById('tblKriterler').style.position = 'relative'; } else { document.getElementById('tblKriterler').style.visibility = 'hidden'; document.getElementById('tblKriterler').style.position = 'absolute'; } return false; } function getKeyEvent(e) { var keynum; var keychar; var numcheck; if (window.event) // IE keynum = e.keyCode else if (e.which) // Netscape/Firefox/Opera keynum = e.which; return keynum; } //txt.Attributes.Add("onkeypress", "return validateNUM(event,this);"); function validateNUM(e, field) { var key = getKeyEvent(e); if ((key == 8) || (key == null)) return true; key = String.fromCharCode(key); var regex = /[0-9]/; if (!regex.test(key)) return false; } function SetAttachmentTabText(tabName, gridID) { if (gridID != null && tabName != null) { var rowCount = gridID.pageRowCount; var tabText = tabName.GetText(); if (tabText.indexOf('(') > -1) tabText = tabText.substring(0, tabText.lastIndexOf("(")); if (rowCount >= 0) tabName.SetText(tabText + "(" + rowCount + ")"); } } function GetBottomMargin(BottomMargin) { if (BottomMargin == 0) BottomMargin = 58; if (BottomMargin == -1) BottomMargin = 68; var sTheme = getCookie('QDMS_THEME'); if (sTheme == 'Aqua') BottomMargin -= 0; if (sTheme == 'Glass') BottomMargin -= 5; if (sTheme == 'BlackGlass') BottomMargin += 2; if (sTheme == 'Office2003 Blue') BottomMargin += 7; if (sTheme == 'Office2003 Olive') BottomMargin += 7; if (sTheme == 'Office2003 Silver') BottomMargin += 7; if (sTheme == 'Plastic Blue') BottomMargin -= 7; if (sTheme == 'Red Wine') BottomMargin -= 4; if (sTheme == 'Soft Orange') BottomMargin += 1; if (sTheme == 'Youthful') BottomMargin += 1; if (sTheme == 'Light') BottomMargin += 15; if (navigator.appName != 'Microsoft Internet Explorer') BottomMargin -= 2; return BottomMargin; } function setRounPanelHeight(RoundPanelID, BottomMargin) { var BottomMargin = GetBottomMargin(BottomMargin); var clientHeight = parseInt(document.documentElement.clientHeight); if (clientHeight != 0) { clientHeight -= parseInt(BottomMargin) + 15; document.getElementById(RoundPanelID).height = parseInt(document.documentElement.clientHeight) - 5 + "px"; } return clientHeight; } function setRounPanelHeight2(RoundPanelID, BottomMargin, BoyutFarki) { var BottomMargin = GetBottomMargin(BottomMargin); var clientHeight = parseInt(document.documentElement.clientHeight); if (clientHeight != 0) { clientHeight -= parseInt(BottomMargin) + parseInt(BoyutFarki) + 10; document.getElementById(RoundPanelID).height = parseInt(document.documentElement.clientHeight) - parseInt(BoyutFarki) + "px"; } return clientHeight; } function SetDivWidth(DivID, Width) { if (IsNumeric(Width)) { var nWidth = parseInt(Width, 10) - 2; if (nWidth > 0) { var div = document.getElementById(DivID); if (div != null) { $("#" + DivID).width(nWidth) } } } } function setRoundPanelWidth(RoundPanelID, RightMargin) { var clientWidth = parseInt(document.documentElement.clientWidth); if (clientWidth != 0) { clientWidth -= parseInt(RightMargin) + 0; document.getElementById(RoundPanelID).Width = parseInt(document.documentElement.clientWidth) - 5 + "px"; } return clientWidth; } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g, ""); } function IsNumeric(sText) { var ValidChars = "0123456789."; for (var i = 0; i < sText.length; i++) { if (ValidChars.indexOf(sText.charAt(i)) == -1) { return false; } } return true; } function SetDivHeight(DivID, Height) { if (IsNumeric(Height)) { var nHeight = parseInt(Height, 10) - 30; if (nHeight > 0) { var div = document.getElementById(DivID); if (div != null) { div.style.height = nHeight.toString() + "px"; } } } } function queryString(Deger) { var URL = location.href; var regEx = null; var exec = null; var Sonuc = null; if (Deger != null) { regEx = new RegExp("(\\?|&)(" + Deger + "=)(.*?)(&|$|#)", "i") exec = regEx.exec(URL) Sonuc = RegExp.$3 } else { regEx = new RegExp("(\\?)(.*?)($)", "i") exec = regEx.exec(URL) Sonuc = RegExp.$2 } return (Sonuc) } function setCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; var oCookie = name + "=" + value + expires + "; path=/; HttpOnly;"; if (location.protocol === 'https:') oCookie += " Secure;"; document.cookie = oCookie; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function eraseCookie(name) { setCookie(name, "", -1); } function RedirectSelf() { alert("d"); } function RedirectParent(RedirectPage) { parent.location = RedirectPage; } //Silmeyin gereklidir. function Dumb() { } function ShowMessage(MessageText, DistributionList, RedirectPage, RedirectType, Widht, Height, wrapMessageWithHTML = '', wrapDistributionListWithHTML = '') { if (MessageText.includes(localStorage.getItem(instanceName + "_qdmsProjectName")) && MessageText.includes("")) { Message = MessageText; } else { MessageText = qHtmlEncode(MessageText); DistributionList = qHtmlEncode(DistributionList); if (wrapMessageWithHTML) { MessageText = wrapMessageWithHTML.replace('{message}', MessageText) } if (wrapDistributionListWithHTML) { DistributionList = wrapDistributionListWithHTML.replace('{distributionlist}', DistributionList) } Message = ""; Message += ""; Message += " "; Message += `" + MessageText + " |
" + DistributionList + " |
' + input.replace(/').text(); } function RemoveFolderInvalidChars(ctrl) { var tbox = document.getElementById(ctrl.id + "_I"); if (!tbox.readOnly) { tbox.value = tbox.value.replace(/[/\\?&'*:|#´"<>]/g, ''); tbox.value = tbox.value.replace(' ', ''); } //tbox.value = tbox.value.replace(/[/\\?%æ½é£!${}&+'^*:|"<>]/g, ''); } function RemoveInvalidCharsFromCode(ctrl) { var tbox = document.getElementById(ctrl.id + "_I"); if (!tbox.readOnly) { tbox.value = tbox.value.replace(/[/\\?%æÆ½é£€₺!${};&¨#+´`'^*:|"<>=]/g, ''); tbox.value = tbox.value.replace(' ', ''); } } function RemoveInvalidCharsFromText(ctrl) { var tbox = document.getElementById(ctrl.id + "_I"); if (!tbox.readOnly) { tbox.value = tbox.value.replace(/[/\\?%æ½é£!${}+'^*:|"<>]/g, ''); } } function RemoveInvalidChars(ctrl) { var tbox = document.getElementById(ctrl.id + "_I"); if (!tbox.readOnly) { tbox.value = tbox.value.replace(/[/\\?&'*:|´"<>]/g, ''); tbox.value = tbox.value.replace(' ', ''); } } function RemoveNonNumeric(ctrl) { var tbox = document.getElementById(ctrl.id + "_I"); tbox.value = tbox.value.replace(/\D/g, ''); } function CallbackPanelError(s, e) { e.handled = true; var message = e.message.replace(/</g, '<').replace(/>/g, '>'); ShowMessage(message, "", "", 2, 800, 400); } function TodayAddDays(day) { var today = new Date(); today.setHours(0, 0, 0, 0); today.setDate(today.getDate() + parseInt(day)); return today; } function SetInformationImageVisibilty(img) { if (img.parentElement.clientWidth - img.parentElement.scrollWidth == 0) img.style.display = 'none'; } function grdIsRowSellected(grd, mesaj) { if (grd.GetRowKey(grd.GetFocusedRowIndex()) == null) { ShowMessage(mesaj, "", "", 2, 400, 300); return false; } return true; } function grdIsMultiRowSellected(grd, mesaj) { if (grd.GetSelectedRowCount() == 0) { ShowMessage(mesaj, "", "", 2, 400, 300); return false; } return true; } function OpenGlobalPopup(popUp, url) { popUp.contentUrl = url; if (navigator.appName != 'Microsoft Internet Explorer') { popUp.RefreshContentUrl(); } popUp.SetSize(document.documentElement.clientWidth - 5, document.documentElement.clientHeight - 5); popUp.Show(); } function htmlDecode(input) { var doc = new DOMParser().parseFromString(input, "text/html"); return doc.documentElement.textContent; } function addFavToList(favTitle, url, id) { var favoriteMenu = $("#favMenuUl"); var sLi = $("").attr("id", "favLi-" + id); var aHref = $("").attr("href", url).attr('target', 'frMain'); var dLi = $("").addClass("d-flex align-items-center").html("" + qHtmlEncode(favTitle) + ""); dLi.appendTo(aHref); aHref.appendTo(sLi); sLi.appendTo(favoriteMenu); } function ChangeStaticItemSvgColor(svgObject) { if (svgObject && svgObject.contentDocument) { let svgDocument = svgObject.contentDocument; let allElements = svgDocument.querySelectorAll("*"); let fillElements = []; let strokeElements = []; for (let item of allElements) { let fill = item.style["fill"] let stroke = item.style["stroke"] if (fill == 'rgb(117, 23, 72)') { fillElements.push(item); } if (stroke == 'rgb(117, 23, 72)') { strokeElements.push(item); } } fillElements.forEach(function (element) { element.style.fill = defaultColor; }); strokeElements.forEach(function (element) { element.style.stroke = defaultColor; }); } } function handleSvgLoad(svgObject) { const svgDocument = svgObject[0].contentDocument; if (svgDocument) { ChangeStaticItemSvgColor(svgObject[0]); } } function SetHiddenValue(hdnId, inputId) { var hdn = document.getElementById(hdnId); var input = document.getElementById(inputId); if (hdn && input) { hdn.value = input.value; } } function SetGridHeight(s, e) { const element = jQuery("#" + s.name); const parentList = element.parents().filter(function () { return this.id.includes("gridContainer"); }); if (parentList.length > 0) { const parentElement = parentList[0]; /* const tabsHeight = GetTabPageHeight(element);*/ const clientInstanceName = element.attr("clientinstancename"); const headerAndFooterHeight = FindHeaderAndFooterElements($(this)); setTimeout(function () { SetQdmsContentDivHeight(parentElement.id, clientInstanceName, headerAndFooterHeight); }, 150); } } function SetTreeHeight(s, e) { const element = jQuery("#" + s.name); const parentList = element.parents().filter(function () { return this.id.includes("treeContainer"); }); if (parentList.length > 0) { const parentElement = parentList[0]; //const tabsHeight = GetTabPageHeight(element); const clientInstanceName = element.attr("clientinstancename"); const headerAndFooterHeight = FindHeaderAndFooterElements($(this)); setTimeout(function () { SetQdmsContentDivHeight(parentElement.id, clientInstanceName, headerAndFooterHeight); }, 150); } } function SetQdmsContentDivHeight(contentId, gridId, extractedHeight) { if ($('#' + contentId)) { let extraElementHeigth = 0; var previousElement = document.getElementById(contentId).previousElementSibling; if (previousElement) { var previousElementStyle = window.getComputedStyle(document.getElementById(contentId).previousElementSibling); var displayValue = previousElementStyle.getPropertyValue('display'); } if (document.getElementById(contentId).id.includes("-extra-") && (!previousElement || (previousElement && displayValue !== 'none'))) { extraElementHeigth = document.getElementById(contentId).id.split('-extra-')[1]; } const paddingHeight = extractedHeight != 0 ? 16 : 0; $('#' + contentId).css('height', (GetPageHeight() - (extractedHeight + (isNaN(parseInt(extraElementHeigth)) ? 0 : parseInt(extraElementHeigth)))) - paddingHeight); GrdOrTreeAdjustSize(contentId, gridId); } } function GrdOrTreeAdjustSize(selector, gridId, extraElementHeigth) { let height = Math.max(0, document.getElementById(selector).style.height.replace('px', '')); eval(gridId).SetHeight(height - (isNaN(parseInt(extraElementHeigth)) ? 0 : parseInt(extraElementHeigth))); eval(gridId).AdjustControl(); } function GetQdmsTables() { let allTableContainer = $(".qdmsfixedtable"); allTableContainer.each(function (s, e) { const headerAndFooterHeight = FindHeaderAndFooterElements($(this)); if ($(this).parent().is("div") && $(this).parent()) { if (e.parentElement.id.toString().includes("tableContainer")) { //const tabsHeight = GetTabPageHeight($(this)); SetQdmsTableContentHeight(e.parentElement.id, headerAndFooterHeight); } } }); } function GetQdmsTablesMessagePopup(contentId, mPopup) { if ($('#' + contentId)) { let wHeight = eval(mPopup).height; $('#' + contentId).css('height', (wHeight - jQuery("#MessagePopup_PWH-1").outerHeight()) - 16); } } function SetQdmsTableContentHeight(contentId, extractedHeight) { if ($('#' + contentId)) { let wHeight = GetPageHeight(); const paddingHeight = extractedHeight != 0 ? 16 : 0; let extraElementHeigth = 0; if (document.getElementById(contentId).id.includes("-extra-")) { extraElementHeigth = document.getElementById(contentId).id.split('-extra-')[1]; } $('#' + contentId).css('height', ((wHeight - extractedHeight) - paddingHeight) - (isNaN(parseInt(extraElementHeigth)) ? 0 : parseInt(extraElementHeigth))); } } function GetPageHeight() { return window.innerHeight ? window.innerHeight : document.body.clientHeight; } function FindHeaderAndFooterElements() { let allHeaders = document.querySelectorAll(".qdmsfixedheader"); let totalHeight = 0; if (allHeaders.length > 0) { for (const header of allHeaders) { if (header.clientHeight > 0) { totalHeight += header.clientHeight; } } } let allFooters = document.querySelectorAll(".qdmsfixedfooter"); if (allFooters.length > 0) { for (const footer of allFooters) { if (footer.clientHeight > 0) { totalHeight += footer.clientHeight; } } } return totalHeight; } function GetTabPageHeight(element) { let tabsHeight = 0; let tabPageParent = element.parents(".dxtcLite.dxtcSys.dxtc-flex.dxtc-top.dxtc-pc"); if (tabPageParent.length > 0) { const children = Array.from(tabPageParent[0].children); for (const childNode of children) { if (childNode.nodeType === 1 && childNode.classList.contains("dxtc-strip") && childNode.classList.contains("dxtc-row") && childNode.classList.contains("dxtc-alLeft") && childNode.classList.contains("dxtc-stripContainer")) { tabsHeight += childNode.clientHeight + 5; } } } return tabsHeight; } function OpenTab(tab, ActiveTabList, url) { var tabName = tab.name; var iframeId = "fr" + tabName.charAt(0).toUpperCase() + tabName.slice(1); if (Contain(ActiveTabList, tabName) == -1) { var iframe = document.getElementById(iframeId); if (iframe) { if (url) { iframe.src = url; } else { iframe.src = iframe.src; } ActiveTabList.push(tabName); } } } function Contain(ArrayObject, needle) { return ArrayObject.indexOf(needle) > -1 ? 1 : -1; } function SetButtonHover() { let allButtons = $(".svgbutton"); allButtons.each(function (s, e) { let div = $("